﻿using Hidistro.Core;
using Hidistro.UI.Common.Controls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI;
using wnxd.Web;

namespace Hidistro.UI.SaleSystem.Tags
{
    public class wnxd_User_Menu : AscxTemplatedWebControl
    {
        protected override void AttachChildControls()
        {
            Control col = this.Controls[0];
            foreach (SiteUrl su in col.Controls.OfType<SiteUrl>())
            {
                if (Globals.GetSiteUrls().UrlData.FormatUrl(su.UrlName).ToLower() == this.Page.Request.Url.AbsolutePath.ToLower())
                {
                    su.NavigateUrl = "javascript:void(0);";
                    ((Web)col.FindControl("wnxd_web")).AddScript("$(function(){$('#" + su.ClientID + "').parent().addClass('advice_colo');});");
                    break;
                }
            }
        }
        protected override void OnInit(EventArgs e)
        {
            if (this.SkinName == null)
            {
                this.SkinName = "/ascx/tags/Common_UserCenter/wnxd_User_Menu.ascx";
            }
            base.OnInit(e);
        }
    }
}
